<%--
  - Author		:	Jaewon Choi
  --%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/pages/includes/taglibs.jspf" %>
<%@ include file="/WEB-INF/pages/includes/variables.jspf" %>
<%@ include file="/WEB-INF/pages/includes/doctype.jspf" %>
<html>
	<head>
<%@ include file="/WEB-INF/pages/includes/metatags.jspf" %>
		<title><fmt:message key="pages.title" /></title>
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirStyles}/common.css" />" />

		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-1.7.2.min.js" />"></script>
		<script type="text/javascript">
			$(function(){
			});
		</script>
	</head>
	<body>
		<div class="bodyWrap">
<%@ include file="/WEB-INF/pages/includes/header.jsp" %>
<%@ include file="/WEB-INF/pages/includes/left.jsp" %>
			<div class="contWrap">
				<div class="menuTitle">
					긴급공지 상세보기
				</div>
				<form id="frm" name="frm" method="post" action="<c:url value="/urgencyNotice/form.do" />">
					<input type="hidden" name="maxnum" value="${param.maxnum}" />
					<input type="hidden" name="page" value="${param.page}" />
					<input type="hidden" name="searchDate" value="${param.searchDate}">
					<input type="hidden" name="startDate" value="${param.startDate}" /> 
					<input type="hidden" name="endDate" value="${param.endDate}" />
					<input type="hidden" name="searchName" value="${param.searchName}" />
					
					<table class="frmTbl">
						<colgroup>
							<col width="176px;" />
							<col width="*" />
							<col width="100px;" />
						</colgroup>
						<tbody>
			 				<tr>
								<th>긴급공지 IDX</th>
								<td colspan="2">
									${urgencyNotice.idx}
									<input type="hidden" name="idx" value="${urgencyNotice.idx}">
								</td>
							</tr>
							<tr>
								<th>브랜드 *</th>
								<td>									
									${urgencyNotice.categoryNm}		
								</td>
							</tr>
							<tr>
								<th>기간</th>
								<td colspan="2">
									<c:choose>
										<c:when test="${not empty urgencyNotice.beginTime and not empty urgencyNotice.endTime}">
											<c:catch var="e">
												<fmt:parseDate var="beginTime" pattern="yyyy-MM-dd HH:mm:ss" value="${urgencyNotice.beginTime}" />
												<fmt:formatDate var="beginTime" value="${beginTime}" pattern="yyyy-MM-dd" />
											</c:catch>
											<c:if test="${not empty e}">
												<c:set var="beginTime" value="${urgencyNotice.beginTime}" />
											</c:if>
											<c:catch var="e">
												<fmt:parseDate var="endTime" pattern="yyyy-MM-dd HH:mm:ss" value="${urgencyNotice.endTime}" />
												<fmt:formatDate var="endTime" value="${endTime}" pattern="yyyy-MM-dd" />
											</c:catch>
											<c:if test="${not empty e}">
												<c:set var="endTime" value="${urgencyNotice.endTime}" />
											</c:if>
											<c:out value="${beginTime}" /> ~ <c:out value="${endTime}" />
										</c:when>
										<c:otherwise>
											항상
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
							<tr>
								<th>제목</th>
								<td colspan="2">
									<c:out value="${urgencyNotice.name}" />
								</td>
							</tr>
							<tr>
								<th>내용</th>
								<td colspan="2">
									<c:if test="${not empty urgencyNoticeImg[0].fileUrl}">
										<img src="${urgencyNoticeImg[0].fileUrl}" class="thumbnailImg" />
									</c:if>
								</td>
							</tr>
							<!-- 
							<tr>
								<td colspan="2">
									<c:if test="${not empty urgencyNoticeImg2[0].fileUrl}">
										<img src="${urgencyNoticeImg2[0].fileUrl}" class="thumbnailImg" />
									</c:if>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<c:if test="${not empty urgencyNoticeImg3[0].fileUrl}">
										<img src="${urgencyNoticeImg3[0].fileUrl}" class="thumbnailImg" />
									</c:if>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<c:if test="${not empty urgencyNoticeImg4[0].fileUrl}">
										<img src="${urgencyNoticeImg4[0].fileUrl}" class="thumbnailImg" />
									</c:if>
								</td>
							</tr>			
							 -->
							<tr>
								<th>링크</th>
								<td colspan="2">									
										${urgencyNotice.url}
								</td>
							</tr>
							 <tr>
								<th>URL 타입</th>
								<td colspan="2">
									<c:choose>
										<c:when test="${urgencyNotice.urlType eq '01'}">내부</c:when>
										<c:when test="${urgencyNotice.urlType eq '02'}">외부</c:when>
									</c:choose>
								</td>
							</tr>	
							<tr>
								<th>노출 여부</th>
								<td colspan="2">
									<c:choose>
										<c:when test="${urgencyNotice.isMain eq '1'}">Yes</c:when>
										<c:when test="${urgencyNotice.isMain eq '0'}">No</c:when>
										<c:otherwise>${urgencyNotice.isMain}</c:otherwise>
									</c:choose>
								</td>
							</tr>							
						</tbody>
					</table>					
					<input type="button" class="btn" value="목록" onclick="javascript:document.listFrm.submit();" />
					<input type="submit" class="btn" value="수정" />		
				</form>
				<form name="listFrm" action="<c:url value="/urgencyNotice/list.do" />" method="post" style="display: none;">
					<input type="hidden" name="maxnum" value="${param.maxnum}" />
					<input type="hidden" name="page" value="${param.page}" />
					<input type="hidden" name="searchDate" value="${param.searchDate}">
					<input type="hidden" name="startDate" value="${param.startDate}" /> 
					<input type="hidden" name="endDate" value="${param.endDate}" />
					<input type="hidden" name="name" value="${param.searchName}" />
				</form>
			</div>
<%@ include file="/WEB-INF/pages/includes/footer.jsp" %>
		</div>
	</body>
</html> 